package com.hkzhao.reportingsystem.component;

import com.hkzhao.reportingsystem.service.MangerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "reportsystem.doctor.authCase")
public class AuthCaseReceiver {
    private static Logger LOGGER = LoggerFactory.getLogger(AuthCaseReceiver.class);
    @Autowired
    private MangerService mangerService;
    @RabbitHandler
    public void handle(String[] username_caseidd_state)
    {
        LOGGER.info("发出案件审核成功或者失败的邮件:{}",username_caseidd_state[0]);
        mangerService.sendAuthCaseInformEmail(username_caseidd_state);
    }
}
